<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Informasi JTK</title>
<!--
<link href="templatemo_style.css" rel="stylesheet" type="text/css" />
-->
<style type="text/css">
@import "<?php echo base_url();?>css/templatemo_style.css";
</style>

</head>
<body>

<div id="templatemo_wrapper">
<div id="templatemo_sidebar">    
<div id="site_title">

<img src="<?php echo base_url();?>images/logo.png" /> 

</div> <!-- end of site_title --> 


<?php
	$this->load->view('sidebar_master_data_view');
?>

</div>

<div id="templatemo_content">
<?php
$data['menu'] = $menu;
$this->load->view('menu_view', $data);
?>
<div class="content_box">

<h3><?php echo $title; ?></h3>
<?php
//echo $act . "<hr>";
switch ($act) {
case "edit" :
	foreach ($data_edit as $row) { ?>
					<?php echo form_open('staff/update'); ?>
					
				<table>
				<tr>
					<td>Nip</td>
					<td><input type="text" name="nip" value=<?php echo $row->nip; ?> readonly></td>	
				</tr>
				<tr>
					<td>Kode Dosen</td>
					<td><input type="text" name="kode_dosen" value="<?php echo $row->kode_dosen; ?>"></td>	
				</tr>
				<tr>
					<td>Nama</td>
					<td><input type="text" name="nama" value="<?php echo $row->nama; ?>"></td>	
				</tr>
				<tr>
					<td>Hp</td>
					<td><input type="text" name="hp" value="<?php echo $row->hp; ?>"></td>	
				</tr>
				<tr>
					<td>Email</td>
					<td><input type="text" name="email" value="<?php echo $row->email; ?>"></td>	
				</tr>				
				<tr>
					<td></td>
					<td><input type="submit" value="Update" ></td>	
				</tr>
					<?php } ?>
				</table>
					<?php form_close(); 
break;
case "add" :
	
	echo form_open('staff/insert'); 			
	echo "
				
				<table>
				<tr>
				<td>Nip </td><td> : </td><td><input type='text' name='nip' placeholder='nip' required autofocus></td>
				</tr>
				<tr>
				<td>Kode Dosen </td><td> : </td><td><input type='text' name='kode_dosen' placeholder='kode_dosen' required></td>
				</tr>
				<tr>
				<td>Nama </td><td> : </td><td><input type='text' name='nama' placeholder='nama' required></td>
				</tr>
				<tr>
				<td>Hp </td><td> : </td><td><input type='text' name='hp' placeholder='hp' required></td>
				</tr>
				<tr>
				<td>Email </td><td> : </td><td><input type='text' name='email' placeholder='email' required></td>
				</tr>			
				<tr>
				<td></td><td> </td><td><input type='submit' value='Simpan'></td>
				</tr>				
				</table>";			
	form_close(); 
	?>
	<?php
	break;
default:
	?>
	<div class="content_box_inner">
	<div class="buttons">
	<?php 
	echo form_button(array('id' => 'button-addnew', 'content' => 'Tambah Baru', 'onClick' => "location.href='".site_url()."staff/add'" ));	
	?>		
	</div>

	<table cellpadding="0" cellspacing="0" border="0" class="display" id="display_table">
	<thead>
	<tr>
	<th>NIP</th>
	<th>Kode Dosen</th>
	<th>Nama</th>
	<th>Hp</th>
	<th>Email</th>
	<th></th>
	</tr>
	</thead>						
	<tbody>
	<?php
	if($anggota_data)
	{
		$i = 0;
		foreach ($anggota_data as $row)
		{
			echo '<tr>';
			echo '<td>'.$row->nip.'</td>';
			echo '<td>'.$row->kode_dosen.'</td>';
			echo '<td>'.$row->nama.'</td>';
			echo '<td>'.$row->hp.'</td>';
			echo '<td>'.$row->email.'</td>';
			echo '<td><a href='.base_url().'staff/edit/'.$row->nip.'>Edit</a>
				&nbsp;&nbsp;
				<a href= '.base_url().'staff/hapus/'.$row->nip.' onClick=\'return confirm("Anda yakin akan menghapus?")\'>Hapus</a></td>';
			//echo '<td>'.form_hidden($i, $row->nip).form_radio('selected_data', $i).'</td>';
			echo '</tr>';
			$i++;
		}
	}
	?>	
	</tbody>
	<tfoot>
	<tr>
	<th></th>
	<th></th>
	<th></th>
	<th>Jumlah Total</th>
	<th>
	<?php
	echo $jum_anggota->jumlah;				
	?></th>
	</tr>
	</tfoot>
	

	</table>
	</div>
	<?php
	break;
}

?>


</div>


</div>
<div class="cleaner"></div>    
</div>

<?php 
$this->load->view('footer_view');
?>

</body>
</html>
